<?php

declare(strict_types=1);

namespace ImiApp\ApiServer\Api\Model\Base;

use Imi\Config\Annotation\ConfigValue;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Table;
use ImiApp\ImiServer\AbstractModel as Model;

/**
 * 运营中心 基类.
 *
 * @Entity(camel=false, bean=true, incrUpdate=false)
 * @Table(name=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\RunCommissionSet.name", default="fa_run_commission_set"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\RunCommissionSet.poolName"))
 * @DDL(sql="CREATE TABLE `fa_run_commission_set` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '运营中心ID',
  `set_id` int(10) DEFAULT NULL COMMENT '角色',
  `run_id` int(10) unsigned DEFAULT '1' COMMENT '运营中心ID',
  `direct1` decimal(5,2) DEFAULT '0.00' COMMENT '销售直推%',
  `indirect1` decimal(5,2) DEFAULT '0.00' COMMENT '销售间接%',
  `direct2` decimal(5,2) DEFAULT '0.00' COMMENT '参与直推%',
  `indirect2` decimal(5,2) DEFAULT '0.00' COMMENT '参与间接%',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='运营中心'", decode="")
 *
 * @property int|null $id 运营中心ID
 * @property int|null $setId 角色
 * @property int|null $runId 运营中心ID
 * @property string|float|int|null $direct1 销售直推%
 * @property string|float|int|null $indirect1 销售间接%
 * @property string|float|int|null $direct2 参与直推%
 * @property string|float|int|null $indirect2 参与间接%
 */
abstract class RunCommissionSetBase extends Model
{
    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEY = 'id';

    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEYS = ["id"];

    /**
     * 运营中心ID.
     * id
     * @Column(name="id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $id = NULL;

    /**
     * 获取 id - 运营中心ID.
     *
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * 赋值 id - 运营中心ID.
     * @param int|null $id id
     * @return static
     */
    public function setId($id)
    {
        $this->id = null === $id ? null : (int)$id;
        return $this;
    }

    /**
     * 角色.
     * set_id
     * @Column(name="set_id", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $setId = NULL;

    /**
     * 获取 setId - 角色.
     *
     * @return int|null
     */
    public function getSetId(): ?int
    {
        return $this->setId;
    }

    /**
     * 赋值 setId - 角色.
     * @param int|null $setId set_id
     * @return static
     */
    public function setSetId($setId)
    {
        $this->setId = null === $setId ? null : (int)$setId;
        return $this;
    }

    /**
     * 运营中心ID.
     * run_id
     * @Column(name="run_id", type="int", length=10, accuracy=0, nullable=true, default="1", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $runId = 1;

    /**
     * 获取 runId - 运营中心ID.
     *
     * @return int|null
     */
    public function getRunId(): ?int
    {
        return $this->runId;
    }

    /**
     * 赋值 runId - 运营中心ID.
     * @param int|null $runId run_id
     * @return static
     */
    public function setRunId($runId)
    {
        $this->runId = null === $runId ? null : (int)$runId;
        return $this;
    }

    /**
     * 销售直推%.
     * direct1
     * @Column(name="direct1", type="decimal", length=5, accuracy=2, nullable=true, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $direct1 = NULL;

    /**
     * 获取 direct1 - 销售直推%.
     *
     * @return string|float|int|null
     */
    public function getDirect1()
    {
        return $this->direct1;
    }

    /**
     * 赋值 direct1 - 销售直推%.
     * @param string|float|int|null $direct1 direct1
     * @return static
     */
    public function setDirect1($direct1)
    {
        $this->direct1 = null === $direct1 ? null : $direct1;
        return $this;
    }

    /**
     * 销售间接%.
     * indirect1
     * @Column(name="indirect1", type="decimal", length=5, accuracy=2, nullable=true, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $indirect1 = NULL;

    /**
     * 获取 indirect1 - 销售间接%.
     *
     * @return string|float|int|null
     */
    public function getIndirect1()
    {
        return $this->indirect1;
    }

    /**
     * 赋值 indirect1 - 销售间接%.
     * @param string|float|int|null $indirect1 indirect1
     * @return static
     */
    public function setIndirect1($indirect1)
    {
        $this->indirect1 = null === $indirect1 ? null : $indirect1;
        return $this;
    }

    /**
     * 参与直推%.
     * direct2
     * @Column(name="direct2", type="decimal", length=5, accuracy=2, nullable=true, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $direct2 = NULL;

    /**
     * 获取 direct2 - 参与直推%.
     *
     * @return string|float|int|null
     */
    public function getDirect2()
    {
        return $this->direct2;
    }

    /**
     * 赋值 direct2 - 参与直推%.
     * @param string|float|int|null $direct2 direct2
     * @return static
     */
    public function setDirect2($direct2)
    {
        $this->direct2 = null === $direct2 ? null : $direct2;
        return $this;
    }

    /**
     * 参与间接%.
     * indirect2
     * @Column(name="indirect2", type="decimal", length=5, accuracy=2, nullable=true, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $indirect2 = NULL;

    /**
     * 获取 indirect2 - 参与间接%.
     *
     * @return string|float|int|null
     */
    public function getIndirect2()
    {
        return $this->indirect2;
    }

    /**
     * 赋值 indirect2 - 参与间接%.
     * @param string|float|int|null $indirect2 indirect2
     * @return static
     */
    public function setIndirect2($indirect2)
    {
        $this->indirect2 = null === $indirect2 ? null : $indirect2;
        return $this;
    }

}
